how to print something in php

61

php print -

$txt_pi = sprintf("El número PI vale %+.2f", 3.1416);

how to use php to print inside html -

<?php
$array = array(1, 2, 3, 4);
?>

<table>
<thead><tr><th>Number</th></tr></thead>
<tbody>
<?php foreach ($array as $num) : ?>
<tr><td><?= htmlspecialchars($num) ?></td></tr>
<?php endforeach ?>
</tbody>
</table>

Comments

Submit
0 Comments